const comment = {
  async comments (parent, { partId, first, skip, after }, ctx, info) {
    // 获取 part.comments
    return ctx.db.query.comments({
      first,
      skip,
      after,
      orderBy: 'createdAt_ASC',
      where: {
        part: {
          id: partId
        }
      }
    }, info)
  }
}

module.exports = { comment }
